<?php
//  防止全局变量造成安全隐患 
include_once('..\\common.php');
CheckAdminLogon();
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


<title>管理</title>
</head>

<body>

<p><a href="setup.php"> 安装 </a></p>
<p>

  <?php //列出成员名单

$DB = DBConnect();
$query = "SELECT id,name,state,password FROM `saler` "; 
$result = mysql_query($query,$DB);


echo "<table cellspacing='1' cellpadding='1' >\n";

echo "<tr><td>成员</td> <td>密码</td> <td>删除</td> <td>激活</td> </tr>\n";
while ($myrow = mysql_fetch_row($result)) 
{	
	if($myrow[1]==="")
		continue;
		
	//<a href='resetpasswd.php?id=%d'>R</a>
	printf("<tr> <td><a href='clientInfo.php?salerid=%d'>%s</a></td>  
		         <td>%s</td> 
				 <td><a href='deleteSaler.php?id=%d'>D</a></td>
				 <td><a href='salerAble.php?salerid=%d&state=%s'>%s</a></td>
		    </tr>\n",  
			$myrow[0], $myrow[1], 
			$myrow[3],
			$myrow[0],
			$myrow[0], $myrow[2]=="enabled"?"disabled":"enabled", $myrow[2]);
}
echo "</table>\n";
?>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<form action="addSaler.php" method="post" name="formadd">
  <table border="1">
  <tr>
    <td>成员</td>
    <td><input type="text" size=20 maxlength=20 name="username"></td>
  </tr>
  <tr>
    <td>密码</td>
    <td><label>
      <input name="password" type="text" id="password" value="111111" />
    </label></td>
  </tr>  
  </table>
  <input name="Submit" type="submit" value="添加成员" >

</form>




</body>
</html>